home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / compress / tar321__.zip / SOURCES.ZIP / QIC02.H < prev    next >
C/C++ Source or Header  |  1994-10-27  |  3KB  |  76 lines

  1. #ifndef Q2_SELECT
  2. /* QIC-02 commnad subset */
  3. #define Q2_SELECT       0x01    /* select the drive */
  4. #define Q2_REWIND       0x21    /* rewind tape */
  5. #define Q2_ERASE        0x22    /* erase tape */
  6. #define Q2_RETENSION    0x24    /* wind tape back and forth */
  7. #define Q2_QIC11        0x26    /* select QIC-11 format */
  8. #define Q2_QIC24        0x27    /* select QIC-24 format */
  9. #define Q2_QIC120       0x28    /* select QIC-120 format */
  10. #define Q2_QIC150       0x29    /* select QIC-150 format */
  11. #define Q2_WRDATA       0x40    /* write data */
  12. #define Q2_WRMARK       0x60    /* write file mark */
  13. #define Q2_RDDATA       0x80    /* read data */
  14. #define Q2_FORWARD      0x81    /* forward space block */
  15. #define Q2_REVERSE      0x81    /* backward space block */
  16. #define Q2_RDMARK       0xA0    /* seek forward for data mark */
  17. #define Q2_EOD          0xA3    /* optional: seek end of data */
  18. #define Q2_RDSTAT       0xC0    /* read status */
  19.  
  20. /* Error/status bits */
  21. #define Q2_ERRFLAG 0x80 /* if present shows that info in byte is valid */
  22. #define Q2_ERRMASK 0x7f
  23.  
  24. #define Q2E_POR  0x0001 /* power-on/reset occured */
  25. #define Q2E_ERM  0x0002 /* end of recorded media */
  26. #define Q2E_BUS  0x0004 /* bus parity error */
  27. #define Q2E_BOM  0x0008 /* beginning of media */
  28. #define Q2E_MBD  0x0010 /* marginal block detected */
  29. #define Q2E_NDT  0x0020 /* no data detected */
  30. #define Q2E_ILL  0x0040 /* illegal command */
  31. #define Q2E_DEAD 0x0080 /* cannot get status from controller */
  32. #define Q2E_FIL  0x0100 /* file mark detected */
  33. #define Q2E_BNL  0x0200 /* block not located */
  34. #define Q2E_UDA  0x0400 /* unrecoverable data error */
  35. #define Q2E_EOM  0x0800 /* end of media */
  36. #define Q2E_WRP  0x1000 /* write protected */
  37. #define Q2E_DFF  0x2000 /* device fault */
  38. #define Q2E_CNI  0x4000 /* cartridge not in place */
  39. #define Q2E_BUSY 0x8000 /* device is not ready */
  40.  
  41. #define Q2E_HARD 0xE6E6 /* hard errors */
  42. #define Q2E_STOP 0xE0C4 /* fatal errors */
  43.  
  44. extern char **qic02_errlist;
  45. extern int  qic02_nerr;
  46.  
  47. #define CTE_DEAD   8
  48. #define CTE_BUSY   16
  49. #define CTE_CLOSED 17
  50. #define CTE_OPENED 18
  51. #define CTE_FAULT (-1)
  52.  
  53. #ifndef BYTE
  54. #    define BYTE unsigned char
  55. #endif
  56. #ifndef WORD
  57. #    define WORD unsigned short
  58. #endif
  59.  
  60. struct qic02_byte_status {
  61.    BYTE status_hi, status_lo;
  62.    BYTE error_cnt_hi, error_cnt_lo;
  63.    BYTE underrun_cnt_hi, underrun_cnt_lo;
  64. };
  65.  
  66. struct qic02_word_status {
  67.    WORD status, error_cnt, underrun_cnt;
  68. };
  69.  
  70. struct init_data {
  71.    WORD base_address, dma_number, irq_number;
  72. };
  73.  
  74. #define UNUSED (WORD)~0
  75. #endif
  76.